Fix task queues.
#include <linux/list.h>
#include <linux/tqueue.h>
-#define DECLARE_WORK(_name, _fn, _arg) \
- struct tq_struct _name = { .routine = _fn, .data = _arg }
+#define DECLARE_TQUEUE(_name, _fn, _arg) \
+ struct tq_struct _name = { LIST_HEAD_INIT((_name).list), 0, _fn, _arg }
+
+#define DECLARE_WORK(_name, _fn, _arg) DECLARE_TQUEUE(_name, _fn, _arg)
#define schedule_work(_w) schedule_task(_w)
#endif /* __QUEUES_H__ */
/* This task is used to defer sending console data until there is space. */
static void xencons_tx_flush_task_routine(void *data);
-static struct tq_struct xencons_tx_flush_task;
+static DECLARE_TQUEUE(xencons_tx_flush_task,
+ xencons_tx_flush_task_routine,
+ NULL);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static struct tty_driver *xencons_driver;
if ( xc_mode == XC_OFF )
return 0;
- INIT_TQUEUE(&xencons_tx_flush_task, xencons_tx_flush_task_routine, NULL);
-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
xencons_driver = alloc_tty_driver((xc_mode == XC_SERIAL) ?
1 : MAX_NR_CONSOLES);
(_name)->pending = 0; \
INIT_WORK(&(_name)->work, (_fn), (_arg)); \
} while ( 0 )
+#define DECLARE_TQUEUE(_name, _fn, _arg) \
+ struct tq_struct _name = { __WORK_INITIALIZER((_name).work, _fn, _arg), \
+ LIST_HEAD_INIT((_name).list), 0 }
typedef struct {
struct list_head list;